package com.gin.supermarket_inventory_system.inventory.dto.param;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.gin.database.dto.param.BasePageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;

/**
 * 库存分页查询条件
 * @since : 2023/10/10 15:56
 * @author : ginstone
 * @version : v1.0.0
 **/
@Getter
@Setter
public class InventoryPageParam extends BasePageParam {
    @Schema(description = "商品信息ID")
    Long commodityId;

    @Override
    public void handleQueryWrapper(QueryWrapper<?> queryWrapper) {
        if (commodityId != null) {
            queryWrapper.eq("commodity_id", commodityId);
        }
    }
}
